import Moment from 'moment';
import Base from './Base';
import SocialLink from './SocialLink';
export default class User extends Base {
  public name = '';
  public description = '';
  public tags = [];
  public avatar?: string;
  public banner?: string;
  public email = '';
  public type: UserType = UserType.NORMAL;
  public languages: string[] = [];
  public birthday = 0;
  public followersCount = 0;
  public isFollower = false;
  public isFollowed = false;
  public viewCount = 0;
  public complimentsCount = 0; // 所有礼物收取的数量
  public videosCount = 0; // 上传的视频的数量
  public audiosCount = 0; // 上传的翻译音频数量
  public isPinned = false;
  public socialLinks: SocialLink[] = [];
  public lastUpdate = 0; // 最近上传时间

  public get uploadsCount(): number {
    return this.videosCount + this.audiosCount;
  }

  public get memberSinceString(): string {
    return Moment(this.createTime).format('MMM YYYY');
  }
}

export enum UserType {
  ADMIN = 0,
  NORMAL = 1,
  TRANSLATOR = 2,
}
